/*
 * CFog.cpp
 *
 *  Created on: Sep 19, 2011
 *      Author: welcome
 */

#include "CFog.h"

namespace GGEngine {

CFog::CFog() :
		m_fogMode(GL_EXP2), m_fogDensity(1.0f), m_fogStart(1.0f), m_fogEnd(1.0f), m_fogColor(
				KD_NULL) {

}
CFog::CFog(GLfloat fogMode) :
		m_fogDensity(1.0f), m_fogStart(1.0f), m_fogEnd(1.0f), m_fogColor(KD_NULL) {
	setFogMode(fogMode);
}

CFog::~CFog() {
}

void CFog::setFogColor(GLfloat *m_fogColor) {
	this->m_fogColor = m_fogColor;
}

void CFog::setFogDensity(GLfloat m_fogDensity) {
	this->m_fogDensity = m_fogDensity;
}

void CFog::setFogEnd(GLfloat m_fogEnd) {
	this->m_fogEnd = m_fogEnd;
}

void CFog::setFogMode(GLfloat m_fogMode) {
	this->m_fogMode = m_fogMode;
}

void CFog::setFogStart(GLfloat m_fogStart) {
	this->m_fogStart = m_fogStart;
}
void CFog::initFog() {
	glFogf(GL_FOG_MODE, m_fogMode);
	if (m_fogColor != KD_NULL){
		glFogfv(GL_FOG_COLOR, m_fogColor);
	}
	glFogf(GL_FOG_DENSITY, m_fogDensity);
	glFogf(GL_FOG_START, m_fogStart);
	glFogf(GL_FOG_END, m_fogEnd);
	glHint(GL_FOG_HINT, GL_FASTEST);
}
} /* namespace GGEngine */
